package LeetCode.month02.day44;

import java.util.Arrays;

public class No452 {
    public int findMinArrowShots(int[][] points) {
        int n = points.length;
        long pre = Long.MIN_VALUE;
        int res = 0;
        Arrays.sort(points,(a,b)->Integer.compare(a[1],b[1]));
        for (int[] point : points) {
            if(point[0]>pre){
                res++;
                pre = point[1];
            }
        }
        return res;
    }
}
